package org.example.schoolbus.controller;

import org.example.schoolbus.entity.ResultBody;
import org.example.schoolbus.service.FeedBackAService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/Checkmessage")
@CrossOrigin(origins ="*")
public class FeedBackAController {
    @Autowired
    private FeedBackAService feedBackAService;
    @RequestMapping("/FeedBackAdmin")
    public ResultBody FeedBackAdmin() {
        List<Map<String,Object>> feedback = feedBackAService.FeedBackAdmin();
        if(feedback!=null)
        {
            return new ResultBody(200,"查看反馈成功",feedback);
        }
        else
            return new ResultBody(400,"查看反馈失败",false);
    }

}
